# from django.test import TestCase
# from baidubce.bce_client_configuration import BceClientConfiguration
# from baidubce.auth.bce_credentials import BceCredentials
# from baidubce.services.bos.bos_client import BosClient
# import hashlib
# import base64
# import uuid
#
#
# bos_host = "bj.bcebos.com"
# acess_key_id = "d7b0528d41804aca885b7ad4cd189d78"
# secret_access_key = "d7b0528d41804aca885b7ad4cd189d78"
#
# config = BceClientConfiguration(BceCredentials(access_key_id=acess_key_id, secret_access_key=secret_access_key), endpoint=bos_host)
#
# client = BosClient(config)
#
# # 1/列出bucket数量
# response = client.list_buckets()
#
# for bucket in response.buckets:
#     if "image" in bucket.name:
#         bucket_name = bucket.name
#
# imgPath = "./许振豪.jpg"
#
# with open(imgPath, "rb") as fp:
#     data = fp.read()
#
# user_headers = {
#     "origin": imgPath.split("/")[-1]
# }
#
# file_name = str(uuid.uuid4())
#
# ext = imgPath.split(".")[-1]
#
# print(file_name)
#
# response = client.put_object_from_string(bucket_name, str(file_name) + "." + ext, data, user_headers=user_headers)
#
# url = "http://" + bucket_name + "." + bos_host + "/" + file_name  + "." + ext
#
# print(url, response)

from qiniu import Auth

AK = "76Yu0cnsWOf0zECf3YO7y-etLb7WrZ2flxbXEtez"
SK = "2x68c0VCUNsX0UUUGbY4SShauUkpBwzFQQ5ErzLc"

auth = Auth(AK, SK)

